<!-- Author:Rain -->
<template>
    <div class="inner">
        <p v-for="p, i in data" :key="i">
            <span>姓名：{{ p.name }}</span>&nbsp;
            <span>年龄：{{ p.age }}</span>
        </p>
    </div>
</template>

<script setup lang="ts">
import { defineProps, toRefs } from 'vue';

interface Person{
    name:string
    age:number
}
type P =Person[];
// defineProps(["data"])//定义第一种方式
// defineProps<{data:P}>() //这种定义的时候还加上了他该是什么样的！
withDefaults(defineProps<{data?:P}>(),{
    data:()=>[{name:"p",age:19}]
})




</script>

<style scoped>
.inner {
    height: 50px;
    margin: 10px;
}
</style>